package com.mz.ozy.net;


import com.mz.ozy.constants.Constants;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;

/**
 * @author
 * @date 2018/8/3
 * @description
 */
public interface ApiService {

    /**
     * 通用的业务请求
     *
     * @param transCode 交易码
     * @param maps      参数
     * @return
     */
    @FormUrlEncoded
    @POST(Constants.Http.baseUrl + "/{transCode}.do")
    Observable<ResponseBody> post(@Path("transCode") String transCode, @FieldMap Map<String, String> maps);

    @POST(Constants.Http.captcha_URL)
    Observable<ResponseBody> getCaptcha();

    @FormUrlEncoded
    @POST(Constants.Http.baseUrl + "/{transCode}.do")
    Observable<ResponseBody> post(@Path("transCode") String transCode, @Field("d") String d, @Field("T") String t);

    /***
     * 上传文件
     * */
    @Multipart
    @POST("abc/pj/pjAppUpload.do")
    Observable<ResponseBody> upload(@Part MultipartBody.Part file);

}
